import { defineStore } from "pinia";
import { isRef, markRaw ,ref, isReactive, computed} from "vue";

export const useAddressStore = defineStore('address',()=>{
  const address = ref({})
 const getAddress =  computed(()=>{
    return address.value
  })
  const updateAddress = (params)=>{
    if(isReactive(params)){
      address.value = markRaw(params)
      console.log(" address.value==>",address.value);
    }else{
    
      address.value = params
    }
   
  }
  return {
    address,
    updateAddress,
    getAddress
  }
})